const query = require('./conn')

module.exports = {

  async getUsers() {
    const sql = "select * from users";
    return await query(sql);
  },

  // 验证账号和密码是否存在
  async checkuserlogin(username, password) {
    if (username == '' || password == '') return false;
    const sql = `select * from users where username='${username}' and password='${password}'`
    let data = await query(sql)
    if (data.length == 0) return false;
    return true
  }


}


